﻿@{
    Layout = null;
}

@{
    string shareTitle = "蓉记红包抢先拿！";
    if (Request.QueryString["pc"].ToUpper() == "YOUCHA9")
    {
        shareTitle = "回坊味道，蓉记红包限量换领孙庆海五仁油茶，鲜到先得！";
    }
}
<!doctype html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
    <title>小伙伴们，快来领蓉记鲜鲜鲜红包吧</title>
    <!-- Bellows Styles -->
    <link href="~/Themes/RongJi/Style/luckybag/css/style.css?v=44" rel="stylesheet" />
</head>
<body>
    <div class="tops">
        <img src="~/Themes/RongJi/Style/luckybag/imgs/top.jpg" class="top_bg" />
        <div class="card_wrapper">
            <img src="~/Themes/RongJi/Style/luckybag/imgs/card.png" class="card" />
        </div>
        <span class="mymoney">
            <button type="button" onclick="showShare()">分享红包给好友</button>
        </span>
    </div>
    <div class="fellows">
        <span class="sharetitle">
            @if (Request.QueryString["pc"].ToUpper() == "YOUCHA9")
            {
                <p>@shareTitle</p><br />
            }

            分享好友即可领取“蓉记鲜红包”
        </span>
    </div>
    <div class="sendTips" onclick="hideShare()"></div>
    <script type="text/javascript">
        function showShare() {
            document.getElementsByClassName('sendTips')[0].style.display = 'block';
        }

        function hideShare() {
            document.getElementsByClassName('sendTips')[0].style.display = 'none';
        }
    </script>

    @if (Request.QueryString["s"] == "1")
    {
        <script type="text/javascript">
            showShare();
        </script>
    }

    <script src="~/Themes/RongJi/Style/base/js/weixinshare.js"></script>

    <script type="text/javascript">
    window.config = {
        link: '@Html.Raw("http://m.rongji365.com/promotion/MyLuckyBag?pc=" + @Request.QueryString["pc"] + "&fid=" + @Kevin.Shop.Business.Core.Components.Cookie.KevinCookieManager.Get("openid"))',
            imgUrl: 'http://m.rongji365.com/staticResource/imgs/hongbao_icon1.jpg',
            img_url: 'http://m.rongji365.com/staticResource/imgs/hongbao_icon1.jpg',
            title: '@shareTitle',
            desc: '蓉记鲜鲜鲜红包来了，还不快来领！'
        };
        function onBridgeReady() {
            WeixinJSBridge.call('showOptionMenu');
        }

        if (typeof WeixinJSBridge == "undefined") {
            if (document.addEventListener) {
                document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
                document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
            }
        } else {
            onBridgeReady();
        }
    </script>

    <script src="~/Themes/RongJi/Style/base/js/jquery-1.10.1.min.js"></script>
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <script>
        $(function () {
            var postData = {
                "currentUrl": window.location.href.replace(window.location.hash, '')
            }
            $.post("http://m.rongji365.com/WeixinJsSdk/ConfigScriptJson", postData, function (wxConfig) {

                wx.config(wxConfig);

                wx.ready(function () {
                    // config信息验证后会执行ready方法，所有接口调用都必须在config接口获得结果之后，config是一个客户端的异步操作，所以如果需要在页面加载时就调用相关接口，则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口，则可以直接调用，不需要放在ready函数中。
                    var config = window.config;
                    wx.onMenuShareAppMessage(config);
                    wx.onMenuShareTimeline(config);
                    wx.onMenuShareQQ(config);
                    wx.onMenuShareWeibo(config);

                    wx.showOptionMenu();
                });

                wx.error(function (res) {

                    // config信息验证失败会执行error函数，如签名过期导致验证失败，具体错误信息可以打开config的debug模式查看，也可以在返回的res参数中查看，对于SPA可以在这里更新签名。

                });
            });
        });
    </script>
    <script type="text/javascript" src="http://js.tongji.linezing.com/3547905/tongji.js"></script>
</body>

</html>
